package cn.iune.erp.accounting;

import java.math.BigDecimal;
import java.sql.Date;
import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;

import com.justep.baas.data.RowState;

/**
 * @author Administrator
 * 会计凭证主表
 *
 */

@Entity
@Table(name = "AccountVoucher")
@NamedQuery(name="AccountVoucher.findAll", query="SELECT a FROM AccountVoucher a")
public class AccountVoucher {

	@Id
	@Column(length=36)
	private String fID;
	
	@Column(length=32)
	private String systemCode;
	@Column(length=4)
	private String billType;
	@Column(length=20)
	private String billTypeName;
	private Date orderDate;
	@Column(length=10)
	private String state = "active";
	@Column(length=10)
	private String status = "open";
	@Column(length=10)
	private String audit = "active";

	private int flowType = 0;
	private int direction = 0;
	private Date confirmDate;
	
	@Column(length=4)
	private String origin;
	@Column(length=20)
	private String originName;
	@Column(length=20)
	private String originNo;
	
	@Column(length=15)
	private String voucherNo;
	
	@Column(precision=38,scale=2)
	private BigDecimal debitAmount = BigDecimal.ZERO;       //借方金额
	@Column(precision=38,scale=2)
	private BigDecimal creditAmount = BigDecimal.ZERO;       //贷方金额
	@Column(length=100)
	private String wordsAmount;       //大写金额
	private int attachQuantity; //附件数量
	
	private int draftFlag = 1; //是底稿还是凭证（底稿界面看不到凭证）：1：代表底稿，0：代表是凭证
	private int formalFlag = 0; //是否抛转标识（已抛转成凭证）：0：代表底稿，1：代表是凭证
	
	private int postedFlag = 0; //过账标识
	private Date postedDate; //过账日期
	@Column(length=15)
	private String rUsercode;
	@Column(length=20)
	private String rUsername;//过账人
	private Timestamp rDatetime;

	private int detailsCount = 0;
	private int maxDetailNo = 0;

//	@Column(length=65)
//	private String departmentNo;
//	@Column(length=256)
//	private String departmentName;
	@Column(length=256)
	private String employeeNo;
	@Column(length=256)
	private String employeeName;

	@Column(length=255)
	private String comments;
	
	@Column(length=15)
	private String cUsercode;
	@Column(length=20)
	private String cUsername;//制单人
	private Timestamp cDatetime;
	@Column(length=15)
	private String tUsercode;
	@Column(length=20)
	private String tUsername;//审核人
	private Timestamp tDatetime;
	@Column(length=15)
	private String eUsercode;
	@Column(length=20)
	private String eUsername;//关单人
	private Timestamp eDatetime;
	@Column(length=15)
	private String pUsercode;
	@Column(length=20)
	private String pUsername;//出纳人
	private Timestamp pDatetime;
	
	@Column(length=65)
	private String userId;

	@Column(length=128)
	private String enterpriseNo;
	@Column(length=128)
	private String enterpriseName;

	@Version
	private int version = 0;
	
	@Transient//非持久字段
	private RowState rowState;
	public RowState getRowState() {
		return rowState;
	}
	public void setRowState(RowState rowState) {
		this.rowState = rowState;
	}
	public String getfID() {
		return fID;
	}
	public void setfID(String fID) {
		this.fID = fID;
	}
	public String getSystemCode() {
		return systemCode;
	}
	public void setSystemCode(String systemCode) {
		this.systemCode = systemCode;
	}
	public String getBillType() {
		return billType;
	}
	public void setBillType(String billType) {
		this.billType = billType;
	}
	public String getBillTypeName() {
		return billTypeName;
	}
	public void setBillTypeName(String billTypeName) {
		this.billTypeName = billTypeName;
	}
	public Date getOrderDate() {
		return orderDate;
	}
	public void setOrderDate(Date orderDate) {
		this.orderDate = orderDate;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getAudit() {
		return audit;
	}
	public void setAudit(String audit) {
		this.audit = audit;
	}
	public int getFlowType() {
		return flowType;
	}
	public void setFlowType(int flowType) {
		this.flowType = flowType;
	}
	public int getDirection() {
		return direction;
	}
	public void setDirection(int direction) {
		this.direction = direction;
	}
	public Date getConfirmDate() {
		return confirmDate;
	}
	public void setConfirmDate(Date confirmDate) {
		this.confirmDate = confirmDate;
	}
	public String getOrigin() {
		return origin;
	}
	public void setOrigin(String origin) {
		this.origin = origin;
	}
	public String getOriginName() {
		return originName;
	}
	public void setOriginName(String originName) {
		this.originName = originName;
	}
	public String getOriginNo() {
		return originNo;
	}
	public void setOriginNo(String originNo) {
		this.originNo = originNo;
	}
	public String getVoucherNo() {
		return voucherNo;
	}
	public void setVoucherNo(String voucherNo) {
		this.voucherNo = voucherNo;
	}
	public BigDecimal getDebitAmount() {
		return debitAmount;
	}
	public void setDebitAmount(BigDecimal debitAmount) {
		this.debitAmount = debitAmount;
	}
	public BigDecimal getCreditAmount() {
		return creditAmount;
	}
	public void setCreditAmount(BigDecimal creditAmount) {
		this.creditAmount = creditAmount;
	}
	public String getWordsAmount() {
		return wordsAmount;
	}
	public void setWordsAmount(String wordsAmount) {
		this.wordsAmount = wordsAmount;
	}
	public int getAttachQuantity() {
		return attachQuantity;
	}
	public void setAttachQuantity(int attachQuantity) {
		this.attachQuantity = attachQuantity;
	}
	public int getDetailsCount() {
		return detailsCount;
	}
	public void setDetailsCount(int detailsCount) {
		this.detailsCount = detailsCount;
	}
	public int getMaxDetailNo() {
		return maxDetailNo;
	}
	public void setMaxDetailNo(int maxDetailNo) {
		this.maxDetailNo = maxDetailNo;
	}
	public String getEmployeeNo() {
		return employeeNo;
	}
	public void setEmployeeNo(String employeeNo) {
		this.employeeNo = employeeNo;
	}
	public String getEmployeeName() {
		return employeeName;
	}
	public void setEmployeeName(String employeeName) {
		this.employeeName = employeeName;
	}
	public String getComments() {
		return comments;
	}
	public void setComments(String comments) {
		this.comments = comments;
	}
	public String getcUsercode() {
		return cUsercode;
	}
	public void setcUsercode(String cUsercode) {
		this.cUsercode = cUsercode;
	}
	public String getcUsername() {
		return cUsername;
	}
	public void setcUsername(String cUsername) {
		this.cUsername = cUsername;
	}
	public Timestamp getcDatetime() {
		return cDatetime;
	}
	public void setcDatetime(Timestamp cDatetime) {
		this.cDatetime = cDatetime;
	}
	public String gettUsercode() {
		return tUsercode;
	}
	public void settUsercode(String tUsercode) {
		this.tUsercode = tUsercode;
	}
	public String gettUsername() {
		return tUsername;
	}
	public void settUsername(String tUsername) {
		this.tUsername = tUsername;
	}
	public Timestamp gettDatetime() {
		return tDatetime;
	}
	public void settDatetime(Timestamp tDatetime) {
		this.tDatetime = tDatetime;
	}
	public String geteUsercode() {
		return eUsercode;
	}
	public void seteUsercode(String eUsercode) {
		this.eUsercode = eUsercode;
	}
	public String geteUsername() {
		return eUsername;
	}
	public void seteUsername(String eUsername) {
		this.eUsername = eUsername;
	}
	public Timestamp geteDatetime() {
		return eDatetime;
	}
	public void seteDatetime(Timestamp eDatetime) {
		this.eDatetime = eDatetime;
	}
	public String getpUsercode() {
		return pUsercode;
	}
	public void setpUsercode(String pUsercode) {
		this.pUsercode = pUsercode;
	}
	public String getpUsername() {
		return pUsername;
	}
	public void setpUsername(String pUsername) {
		this.pUsername = pUsername;
	}
	public Timestamp getpDatetime() {
		return pDatetime;
	}
	public void setpDatetime(Timestamp pDatetime) {
		this.pDatetime = pDatetime;
	}
	public String getrUsercode() {
		return rUsercode;
	}
	public void setrUsercode(String rUsercode) {
		this.rUsercode = rUsercode;
	}
	public String getrUsername() {
		return rUsername;
	}
	public void setrUsername(String rUsername) {
		this.rUsername = rUsername;
	}
	public Timestamp getrDatetime() {
		return rDatetime;
	}
	public void setrDatetime(Timestamp rDatetime) {
		this.rDatetime = rDatetime;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getEnterpriseNo() {
		return enterpriseNo;
	}
	public void setEnterpriseNo(String enterpriseNo) {
		this.enterpriseNo = enterpriseNo;
	}
	public String getEnterpriseName() {
		return enterpriseName;
	}
	public void setEnterpriseName(String enterpriseName) {
		this.enterpriseName = enterpriseName;
	}
	public int getVersion() {
		return version;
	}
	public void setVersion(int version) {
		this.version = version;
	}
	public int getPostedFlag() {
		return postedFlag;
	}
	public void setPostedFlag(int postedFlag) {
		this.postedFlag = postedFlag;
	}
	public Date getPostedDate() {
		return postedDate;
	}
	public void setPostedDate(Date postedDate) {
		this.postedDate = postedDate;
	}
	public int getFormalFlag() {
		return formalFlag;
	}
	public void setFormalFlag(int formalFlag) {
		this.formalFlag = formalFlag;
	}
	public int getDraftFlag() {
		return draftFlag;
	}
	public void setDraftFlag(int draftFlag) {
		this.draftFlag = draftFlag;
	}


}
